<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt"  prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>法律人</title>
	<link rel="stylesheet" type="text/css" href="css/normalize.css">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/my-style.css">
	<!--[if lt IE 9]> 
		<script src="js/html5shiv.min.js"></script> 
	<![endif]-->
</head>
<body style="background:#f5f5f5;">
	<!-- 导航栏 -->
	<header>
		<nav class="navbar navbar-inverse">
			<div class="container">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
		        <span class="sr-only">Toggle navigation</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
		      <a class="navbar-brand" href="index.html">
		        <img alt="LOGO" src="img/50x30.png">
		      </a>
				</div>
				<div class="collapse navbar-collapse" id="navbar-collapse-1">
					<ul class="nav navbar-nav navbar-left">
					 	  <li><a href="index/home">首页</a></li>
				          <li><a href="lawyer/list">法律人</a></li>
				          <li><a href="contract/list">法律产品</a></li>
				          <li  class="cur"><a href="knowledge/index">法律知识</a></li>
					</ul>

					<ul class="nav navbar-nav navbar-right">
						<li><a class="add-btn" href="index/join">法律人入驻<span class="caret"></span></a></li>
				<c:if test="${sessionScope.user == null}">
					<li><a href="user/login">登录</a></li>
					<li><a href="user/register">注册</a></li>
				</c:if>
				<c:if test="${sessionScope.user != null}">
					<li>
					<c:if test="${sessionScope.user.type  == 0}">
					<a href="user/person">${sessionScope.user.username}</a>
					</c:if>
					<c:if test="${sessionScope.user.type  == 1}">
					<a href="lawyer/person">${sessionScope.user.username}</a>
					</c:if>
					<c:if test="${sessionScope.user.type  == 2}">
					<a href="lawyer/person">${sessionScope.user.username}</a>
					</c:if>
					</li>
					<li><a href="user/logout">退出</a></li>
				</c:if>
			</ul>
				</div>
			</div>
		</nav>
	</header>

	<!-- banner -->
	<section>
		<div class="container-lawknow-banner">
			<div class="container">
				<div class="row">
					<div class="col-md-12 col-sm-12 col-xs-12">
						<a href="index/join" class="btn btn-black">立即入驻</a>
					</div>
				</div>
			</div>
		</div>
	</section>


	<section class="lawknow-con">
		<div class="container">
			<div class="row">
			<c:forEach items="${knowledge}" var="knowledge"> 
				<div class="col-md-3 col-sm-4 col-xs-12">
					<div class="thumbnail">
						<a href="knowledge/list?type=${knowledge.key.lawknowid}">
							<div class="media">
							  <div class="media-left">						    
							      <img class="media-object img-circle" src="${knowledge.key.img}" alt="...">
							   </div>
							  <div class="media-body">
							    <h4 class="media-heading">${knowledge.key.name}</h4>
							    <p class="text-muted">${knowledge.key.description}</p>
							  </div>
							</div>
						</a>	
			      <div class="caption clearfix">
			        <div class="col-sm-12 col-xs-12 clear-padding">
			        	<c:forEach items="${knowledge.value}" var="types">
				        	<div class="col-md-4 col-sm-6 col-xs-4 text-center clear-padding">
				        		<a href="knowledge/list?type=${knowledge.key.lawknowid}&s=${types.typeid}">${types.name}</a>
				        	</div>
			        	</c:forEach>
			        </div>
			      </div>
			    </div>
				</div>
				</c:forEach>
			</div>
		</div>
	</section>


	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
</body>
</html>